<template>
  <div id="app">
    <v-header :seller="seller"></v-header>
    <div class="tab">
      <div class="tab-item">
        <router-link to="/goods">商品</router-link>
      </div>
      <div class="tab-item">
        <router-link to="/ratings">评价</router-link>
      </div>
      <div class="tab-item">
        <router-link to="/seller">商家</router-link>
      </div>
    </div>
    
    <router-view></router-view>
  </div>
</template>

<script>
  import head from './components/Header/header.vue'

  const ERR_OK = 0;
  export default {
    components: {
      'v-header': head
    },
    data () {
        return {
            sellerUrl : "/api/seller",
            seller    : {}
        }     
    },
    mounted: function () {
        this.$http.get(this.sellerUrl)
        .then(response => {
            if(response.body.errno==ERR_OK){
                this.seller=response.body.data
            }
        })
        .catch(response => {
            console.log(response)
        });
    }
  }
</script>

<style lang="less" rel="stylesheet/less">
  @import url("./common/less/mixin");

  #app {
    .tab {
      display:flex;
      height:40px;
      line-height:40px;
      text-align:center;
      .border-1px(#ddd); 
        .tab-item {
          flex:1;
          a {
            display: block;
            color: #333;
            &.active {color: red;}
          }
        }

    }
  }
</style>
